-
Notifications
You must be signed in to change notification settings - Fork 8
[WIP] recreate the tsc crash we're seeing in mongosh #551
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
return this._name; | ||
} | ||
async find( | ||
query?: schema.Query<Document>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The moment you change Document to C['schema'] it crashes. I've also changed GenericCollectionSchema to BE the schema (ie. it doesn't have a 'schema' field) and then just pass C here rather than Document, but that also crashes. Note that if you change the parameter you have to change the Promise result too in lockstep because as a test I'm just returning the query.
return this._name; | ||
} | ||
async find( | ||
query?: schema.Query<C['schema']>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing C['schema'] here (and in the return type) to Document does not crash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly changing schema.Query to just be any
here does not crash.
Anything more complicated than that breaks.
This is pretty contrived while mirroring the generics setup/hierarchy in mongosh. I just copy pasted parts. Plan is to try and fix it here, then port the fix over.
Test it and reproduce the crash like this:
This gives you more info:
and then you can at least debug it. Right now things are kinda working at least in my reduced example.